package com.my.study.designPatterns.statePattern;

public class NoQuarterState extends State {

    private GumballMachine gumballMachine;


    public NoQuarterState(GumballMachine gumballMachine) {
        this.gumballMachine = gumballMachine;
    }

    @Override
    public void insertQuarter() {

        System.out.println("Insert a quarter into Gumball Machine");
        gumballMachine.setState(gumballMachine.getHasQuarterState());
    }

    @Override
    public void rejectQuarter() {

        System.out.println("No quarter had been inserted into Gumball Machine ");
    }

    @Override
    public void turnCrank() {

        System.out.println("You turned, but no quarter!");
    }

    @Override
    public void dispense() {

        System.out.println("No quarter");
    }
}
